#!/bin/bash

source  /home/pi/.bashrc

MONTH=$(date +"%m")
DAY=$(date +"%d")
YEAR=$(date +"%Y")
ONE=1
YDAY="$(($DAY-$ONE))"

date

cd /home/pi/thumbnailPage/
#/bin/rm *-$YEAR$MONTH$YDAY*.jpg 
/bin/rm   /home/pi/thumbnailPage/*.jpg 
/bin/rm   /home/pi/thumbnailPage/*.pnm 

/bin/cp /home/pi/motion/*-$YEAR$MONTH$DAY*.jpg  /home/pi/thumbnailPage
pwd
/home/pi/thumbnailPage/scale-make  *-$YEAR$MONTH$DAY*.jpg

date
/bin/mv /home/pi/thumbnailPage/i.html /home/pi/thumbnailPage/index.html 
#ls -ltr  /home/pi/motion/*-$YEAR$MONTH$DAY*.jpg


